<!-- eslint-disable vue/multi-word-component-names -->
<template>
  <div>
    <van-nav-bar title="收藏列表" left-arrow @click-left="$router.back()" />
    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="没有更多了"
      @load="onLoad"
    >
    <HouseItem v-for="(item,index) in list" :key="index" :item="item"></HouseItem>
    </van-list>
  </div>
</template>

<script>
import { getCollect } from '@/api/user'
import HouseItem from '@/components/houseItem.vue'

export default {
  components: { HouseItem },
  data () {
    return {
      list: [],
      loading: false,
      finished: false
    }
  },
  methods: {
    async onLoad () {
      const { body } = await getCollect()
      console.log(body)
      this.list = body
    }
  }
}
</script>

<style>
</style>
